extends Node


# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var camera: Spatial
var camera_parent: Spatial
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	camera = find_node("camera")
	camera_parent = find_node("planet")
	camera.get_parent().remove_child(camera)
	camera_parent.add_child(camera)


func _on_ItemList_item_selected(index: int) -> void:
	if index == 0:
		camera_parent.remove_child(camera)
		camera_parent = get_node("Sun")
		camera_parent.add_child(camera)
	if index == 1:
		camera_parent.remove_child(camera)
		camera_parent = get_node("planet")
		camera_parent.add_child(camera)
	if index == 2:
		camera_parent.remove_child(camera)
		camera_parent = get_node("planet2")
		camera_parent.add_child(camera)
